package me.CSmethod.demo;

import java.util.Random;

public class Text9 {
    public static void main(String[] args) {
        int a[] = {2, 588, 888, 1000, 10000};
        Random r = new Random();
        int b[] = new int[a.length];
        for (int i = 0; i < 5; ) {
            int index = r.nextInt(a.length);
            int prize = a[index];
            boolean flag = check(b, prize);
            if (!flag) {
                b[i] = prize;
                i++;
            }
        }
        for (int i = 0; i < b.length; i++) {
            System.out.println(b[i]+"元的奖金被抽中");
        }
    }

    public static boolean check(int a[], int prize) {
        for (int i = 0; i < a.length; i++) {
            if (a[i] == prize) {
                return true;
            }

        }
        return false;
    }

}